<template>
	<view class="news-flow">
		<!-- type:1信息流-左图右文-图 -->
		<view class="ad-view" v-if="type===1"> 
			<ad adpid="1370656660" @load="onload" @close="onclose" @error="onerror"></ad>
		</view> 
		<!-- type:2信息流-上图下文-图 -->
		<view class="ad-view" v-if="type===2">
			<ad adpid="1993855440" @load="onload" @close="onclose" @error="onerror"></ad>
		</view>
		<!-- type:3信息流-左文右图-图 -->
		<view class="ad-view" v-if="type===3">
			<ad adpid="1711004402" @load="onload" @close="onclose" @error="onerror"></ad>
		</view>
		<!-- type:4信息流-文字悬浮-图 -->
		<view class="ad-view" v-if="type===4">
			<ad adpid="1254038513" @load="onload" @close="onclose" @error="onerror"></ad>
		</view>
		<!-- type:5信息流-左图右文-视频 -->
		<view class="ad-view" v-if="type===5">
			<ad adpid="1176161770" @load="onload" @close="onclose" @error="onerror"></ad>
		</view>
		<!-- type:6信息流-H5-大图 -->
		<view class="ad-view" v-if="type===6">
			<ad adpid="1903077984" @load="onload" @close="onclose" @error="onerror"></ad>
		</view>
		<!-- type:7信息流-H5-大图 -->
		<view class="ad-view" v-if="type===7">
			<ad adpid="1253229863" @load="onload" @close="onclose" @error="onerror"></ad>
		</view>
	</view>
</template>

<script>
	export default {
		name: "news-flow",
		props:{
			type:{
				type: Number,
				default: 1
			}
		},
		data() {
			return {

			}
		},
		methods: {
			onload(e) {
				console.log("onload");
			},
			onclose(e) {
				console.log("onclose: " + e.detail);
			},
			onerror(e) {
				console.log(e)
				console.log("onerror: " + e.detail.errCode + " message:: " + e.detail.errMsg);
			}
		}
	}
</script>

<style scoped lang="less">
	.news-flow{
		.ad-view{
			box-shadow: 0px 0px 10px 3px #eeeaea;
		}
	}
</style>
